/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bgu.ppm.ui.laf;

import com.alee.laf.WebLookAndFeel;
import java.awt.Color;
import java.awt.Paint;
import javax.swing.JTabbedPane;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import org.openide.windows.WindowManager;

/**
 *
 * @author User
 */
public class LafInstaller {
    //205-230

    public static final Color JPANEL_BACKGROUND_COLOR = new Color(237, 237, 237);
    public static final Color UNSELECTED_TAB_PAINT_TOP = new Color(230, 230, 230);
    public static final Color UNSELECTED_TAB_PAINT_BOTTOM = new Color(205, 205, 205);

    public static Paint getSelectedTabPaint(int tabHeight) {
        return ColorUtil.getGradientPaint(0, 0, Color.WHITE, 0, 2 * tabHeight / 3, JPANEL_BACKGROUND_COLOR);
    }

    public static Paint getUnSelectedTabPaint(int tabHeight) {
        return ColorUtil.getGradientPaint(0, 0, UNSELECTED_TAB_PAINT_TOP, 0, 2 * tabHeight / 3, UNSELECTED_TAB_PAINT_BOTTOM);
    }

    public static void install() {
        WebLookAndFeel.install();
        UIManager.put("TabbedContainerUI", PPMTabContainerUI.class.getName());
        UIManager.put("EditorTabDisplayerUI", PPMEditorTabDisplayerUI.class.getName());
        UIManager.put("ViewTabDisplayerUI", PPMViewTabDisplayerUI.class.getName());
        System.setProperty("netbeans.winsys.status_line.path", "bgu/ppm/ui/laf/bgu-ppm-ui-laf-NoStatusBar.instance");

        WindowManager.getDefault().invokeWhenUIReady(new Runnable() {
            @Override
            public void run() {
                SwingUtilities.updateComponentTreeUI(WindowManager.getDefault().getMainWindow());
            }
        });
    }
}
